import request from '@/config/axios'

// 保洁考核区域管理 VO
export interface CleaningAreaVO {
  id: number // 编号
  name: string // 区域名称
  score: number // 分数
}

// 保洁考核区域管理 API
export const CleaningAreaApi = {
  // 查询保洁考核区域管理分页
  getCleaningAreaPage: async (params: any) => {
    return await request.get({ url: `/project/cleaning-area/page`, params })
  },

  // 查询保洁考核区域管理详情
  getCleaningArea: async (id: number) => {
    return await request.get({ url: `/project/cleaning-area/get?id=` + id })
  },

  // 新增保洁考核区域管理
  createCleaningArea: async (data: CleaningAreaVO) => {
    return await request.post({ url: `/project/cleaning-area/create`, data })
  },

  // 修改保洁考核区域管理
  updateCleaningArea: async (data: CleaningAreaVO) => {
    return await request.put({ url: `/project/cleaning-area/update`, data })
  },

  // 删除保洁考核区域管理
  deleteCleaningArea: async (id: number) => {
    return await request.delete({ url: `/project/cleaning-area/delete?id=` + id })
  },

  // 导出保洁考核区域管理 Excel
  exportCleaningArea: async (params) => {
    return await request.download({ url: `/project/cleaning-area/export-excel`, params })
  },

// ==================== 子表（保洁考核详细信息） ====================

  // 获得保洁考核详细信息分页
  getCleaningAreaDetailPage: async (params) => {
    return await request.get({ url: `/project/cleaning-area/cleaning-area-detail/page`, params })
  },
  // 新增保洁考核详细信息
  createCleaningAreaDetail: async (data) => {
    return await request.post({ url: `/project/cleaning-area/cleaning-area-detail/create`, data })
  },

  // 修改保洁考核详细信息
  updateCleaningAreaDetail: async (data) => {
    return await request.put({ url: `/project/cleaning-area/cleaning-area-detail/update`, data })
  },

  // 删除保洁考核详细信息
  deleteCleaningAreaDetail: async (id: number) => {
    return await request.delete({ url: `/project/cleaning-area/cleaning-area-detail/delete?id=` + id })
  },

  // 获得保洁考核详细信息
  getCleaningAreaDetail: async (id: number) => {
    return await request.get({ url: `/project/cleaning-area/cleaning-area-detail/get?id=` + id })
  },
}